﻿@model LiUTrading.Models.AdFormViewModel
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(new AjaxOptions() { UpdateTargetId = "adscontent", HttpMethod = "post", InsertionMode = InsertionMode.Replace }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Ad</legend>
        @Html.HiddenFor(model => model.Ad.AdId)
        <div class="editor-label">
            @Html.LabelFor(model => model.Ad.DateTime)
        </div>
        <div class="editor-field-readonly">
            @Html.TextBoxFor(model => model.Ad.DateTime, new { @readonly = "true" })
            @Html.ValidationMessageFor(model => model.Ad.DateTime)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Ad.UserLiuId)
        </div>
        <div id="editor-field-readonly">
            @Html.TextBoxFor(model => model.Ad.UserLiuId, new { @readonly = "true" })
            @Html.ValidationMessageFor(model => model.Ad.UserLiuId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Ad.Category)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.Ad.Category, Model.Categories)
            @Html.ValidationMessageFor(model => model.Ad.Category)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Ad.Price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Ad.Price)
            @Html.ValidationMessageFor(model => model.Ad.Price)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Ad.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Ad.Title)
            @Html.ValidationMessageFor(model => model.Ad.Title)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Ad.InfoText)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Ad.InfoText, new { @style = "resize:none" })
            @Html.ValidationMessageFor(model => model.Ad.InfoText)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Ad.ImageUrl)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Ad.ImageUrl)
            @Html.ValidationMessageFor(model => model.Ad.ImageUrl)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Ad.UserId, new { style = "display:none" })
            @Html.ValidationMessageFor(model => model.Ad.UserId)
        </div>
    </fieldset>
}